import { RootState } from "@/redux";
import { Descriptions, Drawer } from "antd";
import React from "react";
import { useSelector } from "react-redux";
import { Image } from "antd";
import zhanwei from "@/assets/images/zhanwei.png";

const WorkDetail: React.FC = props => {
	const data = useSelector((state: RootState) => state.work.workDetail);

	return (
		<Descriptions title="作品" bordered column={1}>
			<Descriptions.Item label="标题">{data.work_title}</Descriptions.Item>
			<Descriptions.Item label="描述">{data.work_des}</Descriptions.Item>
			<Descriptions.Item label="地址">
				<a href={data.work_url}>{data.work_url}</a>
			</Descriptions.Item>
			<Descriptions.Item label="修改时间">{data.updatedAt}</Descriptions.Item>
			<Descriptions.Item label="创建时间">{data.createdAt}</Descriptions.Item>
			<Descriptions.Item label="创建时间">
				<Image
					width={140}
					height={80}
					src={data.work_image}
					key={data.id}
					placeholder={<Image width={160} height={80} preview={false} src={zhanwei} />}
				></Image>
			</Descriptions.Item>
		</Descriptions>
	);
};

export default WorkDetail;
